|
 |
> y = llCos(Rot.x)*y - llSin(Rot.x)*z;
> z = llSin(Rot.x)*y + llCos(Rot.x)*z;
This is not going to work, because you are setting the new "y" value in the
first line, then using it in the 2nd line (but you should be using the
previous y value).
Try something like
x2 = x;
y2 = llCos(Rot.x)*y - llSin(Rot.x)*z;
z2 = llSin(Rot.x)*y + llCos(Rot.x)*z;
x = llSin(Rot.y)*z2 + llCos(Rot.y)*x2;
y = y2;
z = llCos(Rot.y)*z2 - llSin(Rot.y)*x2;
x2 = llCos(Rot.z)*x - llSin(Rot.z)*y;
y2 = llSin(Rot.z)*x + llCos(Rot.z)*y;
z2 = z;
npos = <x2,y2,z2>;
Post a reply to this message
|
 |